package com.guigu.tms.aggregation.controller;

import com.github.pagehelper.PageInfo;
import com.guigu.tms.aggregation.service.IOrderService;
import com.guigu.tms.commons.aggregation.entity.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 订单 前端控制器
 * </p>
 *
 * @author wj
 * @since 2022-10-21
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private IOrderService orderService;
    @GetMapping("getOrderById")
    public Order getOrderById(String id){
        return orderService.getOrderById(id);
    }

    @PostMapping("getOrders/{num}/{size}")
    public PageInfo<Order> getOrders(@RequestBody Order order, @PathVariable("num") Integer num, @PathVariable("size") Integer size){
        return orderService.getOrders(order, num, size);
    }
}
